Repository navigation
feat(libkernel): load system libraries from their console paths - #6519
Conversation
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
jotitadev
left a comment
There was a problem hiding this comment.
Linux run (Ubuntu 26.04, Intel i7-8700, GCC 15.2, full build, non-GPU tests), head 57dbfcadd merged onto main 44df21632.
- Builds;
guest_dynamic_loaderandguest_dynamic_loader_fixed_basepass. - With
Module.cppfrommainand the PR's test, both abort atGuestDynamicLoader.cpp:106(the/gkbHtXc3Wq/common/lib/<name>.sprxload), so the test protects the change on Linux too.
Non-GPU suite (ctest -E "^agc"): same result as main; only file_writer_binary and file_writer_text fail, and they fail on main too on this machine (Ubuntu 26.04 coreutils).
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
|
Thanks for the Linux run, @jotitadev, including the check that the test fails at the sandboxed-path load without the change. About the overlap the bot lists with #6544: I merged #6544 with AI-assisted: yes (Claude Code). 🤖 Generated with Claude Code |
PS4 programs load system libraries with sceKernelLoadStartModule and their console path. The OpenOrbis piglet sample loads /<sandbox word>/common/lib/libScePigletv2VSH.sprx and libScePrecompiledShaders.sprx, the sandboxed form of /system/common/lib/ that sceKernelGetFsSandboxRandomWord names. The path was opened as a guest file and the load failed with ENOENT. A path in /system/common/lib/ or in the sandboxed /<word>/common/lib/ whose file name ends in .sprx now loads the host libs/<name>.prx, as libSceSysmodule does for module IDs. Names with a directory part are not mapped, so such a path cannot leave libs/.
57dbfca to
ca75c94
Compare
|
Rebase handoff — this PR conflicts with Windows data (Windows 10 19045, MinGW-w64 GCC 15.2.0, Release): To pick it up: ( AI-assisted (Claude Code). |
What
PS4 programs load system libraries with
sceKernelLoadStartModuleand their console path. The OpenOrbis piglet sample loads/<sandbox word>/common/lib/libScePigletv2VSH.sprxandlibScePrecompiledShaders.sprx, the sandboxed form of/system/common/lib/thatsceKernelGetFsSandboxRandomWordnames. AnyPS5 opened that path as a guest file, so the load failed withENOENTand the sample stopped with:A path in
/system/common/lib/or in the sandboxed/<word>/common/lib/whose file name ends in.sprxnow loads the hostlibs/<name>.prx, as libSceSysmodule does for module IDs. A name with a directory part is not mapped, so such a path cannot leavelibs/. Any other path is opened as before. The new line indocs/dev/debt/libkernel.mdrecords that a host library has nomodule_start, soresis 0, and that other system directories, such as/system/priv/lib, are not mapped. Part of the PS4 homebrew work tracked in #3093.Overlap with open pull requests that change
Module.cppordocs/dev/debt/libkernel.md, checked withgit merge-fileagainstmain03c4cb5e7:#include <mutex>on the line where this adds#include <optional>; whichever merges second keeps both includes.docs/dev/debt/libkernel.md; whichever merges second keeps both entries.Tested
Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release,
BUILD_TESTING=ON, onmain03c4cb5e7:guest_dynamic_loadernow copies its fixture module intolibs/and loads it through/system/common/lib/<name>.sprxand/gkbHtXc3Wq/common/lib/<name>.sprx(gkbHtXc3Wqis AnyPS5's sandbox word). It calls the module's export and unloads it each time. A missing name and a.prxname return0x80020002, and so does/gkbHtXc3Wq/common/lib/../<name>.sprx, even though the file exists one directory up./system/common/lib/prefix not mapped, a name with a directory part mapped.main03c4cb5e7with this, feat(libScePrecompiledShaders): export the texmap shaders the piglet sample uses #6520, feat(libScePigletv2VSH): implement the EGL and GLES 2 calls of the piglet sample #6521, fix(relinker): search libc.prx for libkernel-only Windows executables #5990 to fix(relinker): stop module syscall scans at the PLT and skip the PS4 loader path #5994, feat(libSceFreeType): implement the six FreeType functions OpenOrbis samples use #6376, fix(relinker): accept section-relative guest module relocations #5138 and a change that answers the LinuxTIOCGWINSZwithENOTTY, as fix(libkernel): return ENOTTY for malformed ioctl requests #5569 did: it printsModule prefix = /gkbHtXc3Wq/common/lib/andModules loaded OK., and draws its rotating textured square at 59.96 FPS. WithModule.cppfrommaininstead, it stops with the lines above.agc_driver_gpu_indirect_arguments_misaligned_writer_aheaddoes not compile with MinGW onmain(test(agc): align the indirect arguments block at run time #6452 fixes it), andprx_thread_local_destructorsfails as it did onmain92cdc7b62on this machine without my changes.tools/check_conventions.pypasses.Not tested on Linux or macOS.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code